#pragma once
#include <ntifs.h>
#include "ntstruct.h"

#ifdef DBG
    #define DBGPRINT(_fmt, ...) DbgPrint(_fmt, __VA_ARGS__)
    #define ERRPRINT(s, c) \
        const char* str##s = #s;\
        DbgPrint("%s: %s Error, Code: %X\r\n", __FUNCTION__, str##s, c)
    #define INT3    KdBreakPoint()
#else
    #define DBGPRINT(_fmt, ...) { NOTHING; }
    #define ERRPRINT(s, c)
    #define INT3
#endif

#define USTRING_DEVICE_NAME     L"\\Device\\TestControl"
#define USTRING_SYMBOL_NAME     L"\\DosDevices\\TestControl"

typedef struct _SYSTEM_MEMORY_ADDRESS
{
    ULONG_PTR MmNonPagedPoolStart;
    ULONG_PTR MmNonPagedPoolEnd;
    ULONG_PTR MmPteSpaceStart;
    ULONG_PTR MmPteSpaceEnd;
    ULONG_PTR MmPdeSpaceStart;
    ULONG_PTR MmPdeSpaceEnd;
    ULONG_PTR MmHyperSpaceStart;
    ULONG_PTR MmHyperSpaceEnd;
    ULONG_PTR MmSharedSystemPageStart;
    ULONG_PTR MmSharedSystemPageEnd;
    ULONG_PTR MmSystemCacheWorkingSetStart;
    ULONG_PTR MmSystemCacheWorkingSetEnd;
    ULONG_PTR MmLoaderMappingsStart;
    ULONG_PTR MmLoaderMappingsEnd;
    ULONG_PTR MmSystemPteStart;
    ULONG_PTR MmSystemPteEnd;
    ULONG_PTR MmPagedPoolStart;
    ULONG_PTR MmPagedPoolEnd;
    ULONG_PTR MmSessionSpaceStart;
    ULONG_PTR MmSessionSpaceEnd;
    ULONG_PTR MmDynamicVASpaceStart;
    ULONG_PTR MmDynamicVASpaceEnd;
    ULONG_PTR MmPfnDatabaseStart;
    ULONG_PTR MmPfnDatabaseEnd;
}SYSTEM_MEMORY_ADDRESS, * PSYSTEM_MEMORY_ADDRESS;

typedef struct _SCANNER_GLOBALS
{
    KDDEBUGGER_DATA64 KdDebuggerData;
    SYSTEM_MEMORY_ADDRESS MmSystemSpace;
}SCANNER_GLOBALS, * PSCANNER_GLOBALS;

extern PDEVICE_OBJECT g_lpDeviceObject;
extern SCANNER_GLOBALS ScanGlobals;
